package com.gigi.controller;

import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.Response;
import com.gigi.model.AppealDO;
import com.gigi.model.ListAppealRequest;
import com.gigi.service.manual.AppealManageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 申诉管理
 */
@RestController
@RequestMapping("appeal-manage")
public class AppealManageController {

    private final AppealManageService appealManageService;

    public AppealManageController(AppealManageService appealManageService) {
        this.appealManageService = appealManageService;
    }

    @ApiOperation(value = "列表")
    @PostMapping("/list")
    public MultiResponse<AppealDO> list(@RequestBody ListAppealRequest request) {
        return appealManageService.list(request);
    }

    @ApiOperation(value = "保存")
    @PostMapping("/save")
    public Response save(@RequestBody AppealDO request) {
        return appealManageService.save(request);
    }

}
